package controllers.api;

import models.User;
import models.WallComment;

public class Comment extends API {
	public static void comment(){
		String comment=request.params.get("comment");
		String id=request.params.get("idofpost");
		WallComment wallcomment=new WallComment();
		wallcomment.setComment(comment);
		wallcomment.setWallThreadId(id);
		User from=User.find("by_id",session.get("sessionUser")).first();
		wallcomment.setFromId(from.getId());
		wallcomment.setFromName(from.getName());
		wallcomment.setFromPrPhoto(from.getPrPhoto());
		wallcomment.save();
		json(wallcomment);
	}
}
